package org.xjst.ui
{
	import com.google.maps.LatLng;
	import com.google.maps.overlays.XjuMarker;
	
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import mx.containers.VBox;
	import mx.controls.Button;
	import mx.controls.Image;
	import mx.controls.Label;
	import mx.controls.Text;
	import mx.controls.TextArea;
	import mx.controls.TextInput;
	import mx.core.UIComponent;
	import mx.events.FlexEvent;
	
public class InfoPane
{
	private var _marker:XjuMarker;
	
	//UIs
	private var _list 
	
	private var _vboxOuter:VBox;
	private var _labelName:Label; // 名称
	private var _img:Image; // 用用于盛放图片.
	private var _text:Text; // 详细介绍
	

	
	private var _editable:Boolean; // 是否可编辑.
	
	// Constructor
	public function InfoPane() {
	}
	
	public function set marker(marker_:XjuMarker):void {
		_marker = marker_;
		updateUI();
	}
	
	public function get editable():Boolean {
		return _editable;
	}
	
	public function set editable(editable_:Boolean):void {
		_editable = editable_;
		updateUI();
	}
	
	private function updateUI():void {
		ui;
		_labelName.text = _marker.name;
		_img.source = _marker.photoURL;
		_text.text = _marker.des;
		
		if(_editable) {
			
		}else {
			
		}
	}
	
	/** 获得UI. */
	public function get ui():UIComponent {
		if(_vboxOuter == null) {
			_vboxOuter = new VBox();
			_labelName = new Label();
			_img = new Image();
			_text = new Text();
			
			_img.percentWidth = 100;
			_vboxOuter.addChild(_labelName);
			_vboxOuter.addChild(_img);
			_vboxOuter.addChild(_text);
		}
		
		return _vboxOuter;
	} 
	

} // end of class
} // End of package